package com.acme.bankapp.domain.bank;

public abstract class AbstractAccount implements Account {

	protected int id;
	protected double balance;

	public AbstractAccount(final double amount) throws IllegalArgumentException {
		if (amount < 0) {
            throw new IllegalArgumentException("Negative balance");
        }
        this.balance = amount;

	}

	public double getBalance() {
		return balance;
	}

    @Override
    public void deposit(final double amount) {
        balance += amount;
    }

    public abstract void withdraw(final double amount) throws NotEnoughFundsException;

}
